#!/bin/bash

# 获取前一个commit
# precommit=$(git rev-parse --short HEAD^^)

precommit=$1

if [ -z "$precommit" ]; then
    echo "please input precommit"
    exit
fi

echo $precommit


# 获取当前commit 
commit=$(git rev-parse --short HEAD)
echo $commit


git archive --format=zip --output=./app.zip $commit $(git diff --name-only --diff-filter=ACMR $precommit $commit | grep -v 'config.php')

unzip -l app.zip